console.log("preload js loaded")

const fs = require('fs')

window.saveFile = function(data, val) {
  console.log(data, val)
  fs.writeFileSync(data, val)
}


window.readFile = function(data) {
  console.log(data)
  let res = fs.readFileSync(data)
  console.log('window.readFile res', res.toString())
  return res.toString()
}